3.2.57 \(\int \tanh ^3(c+d x) (a+b \tanh ^2(c+d x))^3 \, dx\) [157]

3.2.57.1 Optimal result
3.2.57.2 Mathematica [A] (verified)
3.2.57.3 Rubi [A] (verified)
3.2.57.4 Maple [B] (verified)
3.2.57.5 Fricas [B] (verification not implemented)
3.2.57.6 Sympy [B] (verification not implemented)
3.2.57.7 Maxima [B] (verification not implemented)
3.2.57.8 Giac [B] (verification not implemented)
3.2.57.9 Mupad [B] (verification not implemented)

3.2.57.1 Optimal result

Integrand size = 23, antiderivative size = 107 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right )^3 \, dx=\frac {(a+b)^3 \log (\cosh (c+d x))}{d}-\frac {(a+b)^3 \tanh ^2(c+d x)}{2 d}-\frac {b \left (3 a^2+3 a b+b^2\right ) \tanh ^4(c+d x)}{4 d}-\frac {b^2 (3 a+b) \tanh ^6(c+d x)}{6 d}-\frac {b^3 \tanh ^8(c+d x)}{8 d} \]

output
(a+b)^3*ln(cosh(d*x+c))/d-1/2*(a+b)^3*tanh(d*x+c)^2/d-1/4*b*(3*a^2+3*a*b+b 
^2)*tanh(d*x+c)^4/d-1/6*b^2*(3*a+b)*tanh(d*x+c)^6/d-1/8*b^3*tanh(d*x+c)^8/ 
d
 
3.2.57.2 Mathematica [A] (verified)

Time = 0.35 (sec) , antiderivative size = 98, normalized size of antiderivative = 0.92 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right )^3 \, dx=\frac {2 (a+b)^3 \log (\cosh (c+d x))-(a+b)^3 \tanh ^2(c+d x)-\frac {1}{2} b \left (3 a^2+3 a b+b^2\right ) \tanh ^4(c+d x)-\frac {1}{3} b^2 (3 a+b) \tanh ^6(c+d x)-\frac {1}{4} b^3 \tanh ^8(c+d x)}{2 d} \]

input
Integrate[Tanh[c + d*x]^3*(a + b*Tanh[c + d*x]^2)^3,x]
 
output
(2*(a + b)^3*Log[Cosh[c + d*x]] - (a + b)^3*Tanh[c + d*x]^2 - (b*(3*a^2 + 
3*a*b + b^2)*Tanh[c + d*x]^4)/2 - (b^2*(3*a + b)*Tanh[c + d*x]^6)/3 - (b^3 
*Tanh[c + d*x]^8)/4)/(2*d)
 
3.2.57.3 Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 104, normalized size of antiderivative = 0.97, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {3042, 26, 4153, 26, 354, 86, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right )^3 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int i \tan (i c+i d x)^3 \left (a-b \tan (i c+i d x)^2\right )^3dx\)

\(\Big \downarrow \) 26

\(\displaystyle i \int \tan (i c+i d x)^3 \left (a-b \tan (i c+i d x)^2\right )^3dx\)

\(\Big \downarrow \) 4153

\(\displaystyle \frac {i \int -\frac {i \tanh ^3(c+d x) \left (b \tanh ^2(c+d x)+a\right )^3}{1-\tanh ^2(c+d x)}d\tanh (c+d x)}{d}\)

\(\Big \downarrow \) 26

\(\displaystyle \frac {\int \frac {\tanh ^3(c+d x) \left (b \tanh ^2(c+d x)+a\right )^3}{1-\tanh ^2(c+d x)}d\tanh (c+d x)}{d}\)

\(\Big \downarrow \) 354

\(\displaystyle \frac {\int \frac {\tanh ^2(c+d x) \left (b \tanh ^2(c+d x)+a\right )^3}{1-\tanh ^2(c+d x)}d\tanh ^2(c+d x)}{2 d}\)

\(\Big \downarrow \) 86

\(\displaystyle \frac {\int \left (-b^3 \tanh ^6(c+d x)-b^2 (3 a+b) \tanh ^4(c+d x)-b \left (3 a^2+3 b a+b^2\right ) \tanh ^2(c+d x)-(a+b)^3-\frac {(a+b)^3}{\tanh ^2(c+d x)-1}\right )d\tanh ^2(c+d x)}{2 d}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {-\frac {1}{2} b \left (3 a^2+3 a b+b^2\right ) \tanh ^4(c+d x)-\frac {1}{3} b^2 (3 a+b) \tanh ^6(c+d x)-(a+b)^3 \tanh ^2(c+d x)-(a+b)^3 \log \left (1-\tanh ^2(c+d x)\right )-\frac {1}{4} b^3 \tanh ^8(c+d x)}{2 d}\)

input
Int[Tanh[c + d*x]^3*(a + b*Tanh[c + d*x]^2)^3,x]
 
output
(-((a + b)^3*Log[1 - Tanh[c + d*x]^2]) - (a + b)^3*Tanh[c + d*x]^2 - (b*(3 
*a^2 + 3*a*b + b^2)*Tanh[c + d*x]^4)/2 - (b^2*(3*a + b)*Tanh[c + d*x]^6)/3 
 - (b^3*Tanh[c + d*x]^8)/4)/(2*d)
 

3.2.57.3.1 Defintions of rubi rules used

rule 26
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a])   I 
nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
 

rule 86
Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_ 
.), x_] :> Int[ExpandIntegrand[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; 
 FreeQ[{a, b, c, d, e, f, n}, x] && ((ILtQ[n, 0] && ILtQ[p, 0]) || EqQ[p, 1 
] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p 
+ 1, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))
 

rule 354
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S 
ymbol] :> Simp[1/2   Subst[Int[x^((m - 1)/2)*(a + b*x)^p*(c + d*x)^q, x], x 
, x^2], x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && IntegerQ 
[(m - 1)/2]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4153
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], 
 x]}, Simp[c*(ff/f)   Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f 
f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, 
n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio 
nalQ[n]))
 
3.2.57.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(204\) vs. \(2(99)=198\).

Time = 0.14 (sec) , antiderivative size = 205, normalized size of antiderivative = 1.92

method result size
derivativedivides \(\frac {-\frac {\tanh \left (d x +c \right )^{6} a \,b^{2}}{2}-\frac {3 \tanh \left (d x +c \right )^{4} a^{2} b}{4}-\frac {3 \tanh \left (d x +c \right )^{4} a \,b^{2}}{4}-\frac {3 \tanh \left (d x +c \right )^{2} a^{2} b}{2}-\frac {3 a \,b^{2} \tanh \left (d x +c \right )^{2}}{2}-\frac {\tanh \left (d x +c \right )^{6} b^{3}}{6}-\frac {b^{3} \tanh \left (d x +c \right )^{4}}{4}-\frac {\tanh \left (d x +c \right )^{2} a^{3}}{2}-\frac {b^{3} \tanh \left (d x +c \right )^{2}}{2}-\frac {\tanh \left (d x +c \right )^{8} b^{3}}{8}+\frac {\left (-a^{3}-3 a^{2} b -3 a \,b^{2}-b^{3}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}-\frac {\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}}{d}\) \(205\)
default \(\frac {-\frac {\tanh \left (d x +c \right )^{6} a \,b^{2}}{2}-\frac {3 \tanh \left (d x +c \right )^{4} a^{2} b}{4}-\frac {3 \tanh \left (d x +c \right )^{4} a \,b^{2}}{4}-\frac {3 \tanh \left (d x +c \right )^{2} a^{2} b}{2}-\frac {3 a \,b^{2} \tanh \left (d x +c \right )^{2}}{2}-\frac {\tanh \left (d x +c \right )^{6} b^{3}}{6}-\frac {b^{3} \tanh \left (d x +c \right )^{4}}{4}-\frac {\tanh \left (d x +c \right )^{2} a^{3}}{2}-\frac {b^{3} \tanh \left (d x +c \right )^{2}}{2}-\frac {\tanh \left (d x +c \right )^{8} b^{3}}{8}+\frac {\left (-a^{3}-3 a^{2} b -3 a \,b^{2}-b^{3}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}-\frac {\left (a^{3}+3 a^{2} b +3 a \,b^{2}+b^{3}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}}{d}\) \(205\)
parts \(\frac {a^{3} \left (-\frac {\tanh \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}+\frac {b^{3} \left (-\frac {\tanh \left (d x +c \right )^{8}}{8}-\frac {\tanh \left (d x +c \right )^{6}}{6}-\frac {\tanh \left (d x +c \right )^{4}}{4}-\frac {\tanh \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}+\frac {3 a \,b^{2} \left (-\frac {\tanh \left (d x +c \right )^{6}}{6}-\frac {\tanh \left (d x +c \right )^{4}}{4}-\frac {\tanh \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}+\frac {3 a^{2} b \left (-\frac {\tanh \left (d x +c \right )^{4}}{4}-\frac {\tanh \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}\) \(226\)
parallelrisch \(-\frac {3 \tanh \left (d x +c \right )^{8} b^{3}+12 \tanh \left (d x +c \right )^{6} a \,b^{2}+4 \tanh \left (d x +c \right )^{6} b^{3}+18 \tanh \left (d x +c \right )^{4} a^{2} b +18 \tanh \left (d x +c \right )^{4} a \,b^{2}+6 b^{3} \tanh \left (d x +c \right )^{4}+24 a^{3} d x +72 a^{2} b d x +72 a \,b^{2} d x +24 b^{3} d x +12 \tanh \left (d x +c \right )^{2} a^{3}+36 \tanh \left (d x +c \right )^{2} a^{2} b +36 a \,b^{2} \tanh \left (d x +c \right )^{2}+12 b^{3} \tanh \left (d x +c \right )^{2}+24 \ln \left (1-\tanh \left (d x +c \right )\right ) a^{3}+72 \ln \left (1-\tanh \left (d x +c \right )\right ) a^{2} b +72 \ln \left (1-\tanh \left (d x +c \right )\right ) a \,b^{2}+24 \ln \left (1-\tanh \left (d x +c \right )\right ) b^{3}}{24 d}\) \(238\)
risch \(-a^{3} x -3 b \,a^{2} x -3 a \,b^{2} x -b^{3} x -\frac {2 a^{3} c}{d}-\frac {6 b c \,a^{2}}{d}-\frac {6 a \,b^{2} c}{d}-\frac {2 b^{3} c}{d}+\frac {2 \,{\mathrm e}^{2 d x +2 c} \left (27 a \,b^{2}+3 a^{3}+18 a^{2} b \,{\mathrm e}^{12 d x +12 c}+108 a \,b^{2} {\mathrm e}^{10 d x +10 c}+90 a^{2} b \,{\mathrm e}^{10 d x +10 c}+27 a \,b^{2} {\mathrm e}^{12 d x +12 c}+100 \,{\mathrm e}^{4 d x +4 c} b^{3}+18 a^{2} b +108 \,{\mathrm e}^{2 d x +2 c} a \,b^{2}+90 a^{2} b \,{\mathrm e}^{2 d x +2 c}+237 a \,b^{2} {\mathrm e}^{4 d x +4 c}+198 a^{2} b \,{\mathrm e}^{4 d x +4 c}+252 a^{2} b \,{\mathrm e}^{6 d x +6 c}+312 a \,b^{2} {\mathrm e}^{6 d x +6 c}+12 b^{3}+198 a^{2} b \,{\mathrm e}^{8 d x +8 c}+237 a \,b^{2} {\mathrm e}^{8 d x +8 c}+12 b^{3} {\mathrm e}^{12 d x +12 c}+60 a^{3} {\mathrm e}^{6 d x +6 c}+104 \,{\mathrm e}^{6 d x +6 c} b^{3}+45 a^{3} {\mathrm e}^{4 d x +4 c}+18 a^{3} {\mathrm e}^{2 d x +2 c}+36 \,{\mathrm e}^{2 d x +2 c} b^{3}+36 b^{3} {\mathrm e}^{10 d x +10 c}+100 b^{3} {\mathrm e}^{8 d x +8 c}+18 a^{3} {\mathrm e}^{10 d x +10 c}+3 a^{3} {\mathrm e}^{12 d x +12 c}+45 a^{3} {\mathrm e}^{8 d x +8 c}\right )}{3 d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{8}}+\frac {\ln \left ({\mathrm e}^{2 d x +2 c}+1\right ) a^{3}}{d}+\frac {3 b \ln \left ({\mathrm e}^{2 d x +2 c}+1\right ) a^{2}}{d}+\frac {3 \ln \left ({\mathrm e}^{2 d x +2 c}+1\right ) a \,b^{2}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{d}\) \(544\)

input
int(tanh(d*x+c)^3*(a+b*tanh(d*x+c)^2)^3,x,method=_RETURNVERBOSE)
 
output
1/d*(-1/2*tanh(d*x+c)^6*a*b^2-3/4*tanh(d*x+c)^4*a^2*b-3/4*tanh(d*x+c)^4*a* 
b^2-3/2*tanh(d*x+c)^2*a^2*b-3/2*a*b^2*tanh(d*x+c)^2-1/6*tanh(d*x+c)^6*b^3- 
1/4*b^3*tanh(d*x+c)^4-1/2*tanh(d*x+c)^2*a^3-1/2*b^3*tanh(d*x+c)^2-1/8*tanh 
(d*x+c)^8*b^3+1/2*(-a^3-3*a^2*b-3*a*b^2-b^3)*ln(tanh(d*x+c)+1)-1/2*(a^3+3* 
a^2*b+3*a*b^2+b^3)*ln(tanh(d*x+c)-1))
 
3.2.57.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 7502 vs. \(2 (99) = 198\).

Time = 0.34 (sec) , antiderivative size = 7502, normalized size of antiderivative = 70.11 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right )^3 \, dx=\text {Too large to display} \]

input
integrate(tanh(d*x+c)^3*(a+b*tanh(d*x+c)^2)^3,x, algorithm="fricas")
 
output
Too large to include
 
3.2.57.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 279 vs. \(2 (94) = 188\).

Time = 0.27 (sec) , antiderivative size = 279, normalized size of antiderivative = 2.61 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right )^3 \, dx=\begin {cases} a^{3} x - \frac {a^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {a^{3} \tanh ^{2}{\left (c + d x \right )}}{2 d} + 3 a^{2} b x - \frac {3 a^{2} b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {3 a^{2} b \tanh ^{4}{\left (c + d x \right )}}{4 d} - \frac {3 a^{2} b \tanh ^{2}{\left (c + d x \right )}}{2 d} + 3 a b^{2} x - \frac {3 a b^{2} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {a b^{2} \tanh ^{6}{\left (c + d x \right )}}{2 d} - \frac {3 a b^{2} \tanh ^{4}{\left (c + d x \right )}}{4 d} - \frac {3 a b^{2} \tanh ^{2}{\left (c + d x \right )}}{2 d} + b^{3} x - \frac {b^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {b^{3} \tanh ^{8}{\left (c + d x \right )}}{8 d} - \frac {b^{3} \tanh ^{6}{\left (c + d x \right )}}{6 d} - \frac {b^{3} \tanh ^{4}{\left (c + d x \right )}}{4 d} - \frac {b^{3} \tanh ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a + b \tanh ^{2}{\left (c \right )}\right )^{3} \tanh ^{3}{\left (c \right )} & \text {otherwise} \end {cases} \]

input
integrate(tanh(d*x+c)**3*(a+b*tanh(d*x+c)**2)**3,x)
 
output
Piecewise((a**3*x - a**3*log(tanh(c + d*x) + 1)/d - a**3*tanh(c + d*x)**2/ 
(2*d) + 3*a**2*b*x - 3*a**2*b*log(tanh(c + d*x) + 1)/d - 3*a**2*b*tanh(c + 
 d*x)**4/(4*d) - 3*a**2*b*tanh(c + d*x)**2/(2*d) + 3*a*b**2*x - 3*a*b**2*l 
og(tanh(c + d*x) + 1)/d - a*b**2*tanh(c + d*x)**6/(2*d) - 3*a*b**2*tanh(c 
+ d*x)**4/(4*d) - 3*a*b**2*tanh(c + d*x)**2/(2*d) + b**3*x - b**3*log(tanh 
(c + d*x) + 1)/d - b**3*tanh(c + d*x)**8/(8*d) - b**3*tanh(c + d*x)**6/(6* 
d) - b**3*tanh(c + d*x)**4/(4*d) - b**3*tanh(c + d*x)**2/(2*d), Ne(d, 0)), 
 (x*(a + b*tanh(c)**2)**3*tanh(c)**3, True))
 
3.2.57.7 Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 540 vs. \(2 (99) = 198\).

Time = 0.29 (sec) , antiderivative size = 540, normalized size of antiderivative = 5.05 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right )^3 \, dx=a b^{2} {\left (3 \, x + \frac {3 \, c}{d} + \frac {3 \, \log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, {\left (9 \, e^{\left (-2 \, d x - 2 \, c\right )} + 18 \, e^{\left (-4 \, d x - 4 \, c\right )} + 34 \, e^{\left (-6 \, d x - 6 \, c\right )} + 18 \, e^{\left (-8 \, d x - 8 \, c\right )} + 9 \, e^{\left (-10 \, d x - 10 \, c\right )}\right )}}{d {\left (6 \, e^{\left (-2 \, d x - 2 \, c\right )} + 15 \, e^{\left (-4 \, d x - 4 \, c\right )} + 20 \, e^{\left (-6 \, d x - 6 \, c\right )} + 15 \, e^{\left (-8 \, d x - 8 \, c\right )} + 6 \, e^{\left (-10 \, d x - 10 \, c\right )} + e^{\left (-12 \, d x - 12 \, c\right )} + 1\right )}}\right )} + \frac {1}{3} \, b^{3} {\left (3 \, x + \frac {3 \, c}{d} + \frac {3 \, \log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {8 \, {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 9 \, e^{\left (-4 \, d x - 4 \, c\right )} + 25 \, e^{\left (-6 \, d x - 6 \, c\right )} + 26 \, e^{\left (-8 \, d x - 8 \, c\right )} + 25 \, e^{\left (-10 \, d x - 10 \, c\right )} + 9 \, e^{\left (-12 \, d x - 12 \, c\right )} + 3 \, e^{\left (-14 \, d x - 14 \, c\right )}\right )}}{d {\left (8 \, e^{\left (-2 \, d x - 2 \, c\right )} + 28 \, e^{\left (-4 \, d x - 4 \, c\right )} + 56 \, e^{\left (-6 \, d x - 6 \, c\right )} + 70 \, e^{\left (-8 \, d x - 8 \, c\right )} + 56 \, e^{\left (-10 \, d x - 10 \, c\right )} + 28 \, e^{\left (-12 \, d x - 12 \, c\right )} + 8 \, e^{\left (-14 \, d x - 14 \, c\right )} + e^{\left (-16 \, d x - 16 \, c\right )} + 1\right )}}\right )} + 3 \, a^{2} b {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {4 \, {\left (e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )}\right )}}{d {\left (4 \, e^{\left (-2 \, d x - 2 \, c\right )} + 6 \, e^{\left (-4 \, d x - 4 \, c\right )} + 4 \, e^{\left (-6 \, d x - 6 \, c\right )} + e^{\left (-8 \, d x - 8 \, c\right )} + 1\right )}}\right )} + a^{3} {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} \]

input
integrate(tanh(d*x+c)^3*(a+b*tanh(d*x+c)^2)^3,x, algorithm="maxima")
 
output
a*b^2*(3*x + 3*c/d + 3*log(e^(-2*d*x - 2*c) + 1)/d + 2*(9*e^(-2*d*x - 2*c) 
 + 18*e^(-4*d*x - 4*c) + 34*e^(-6*d*x - 6*c) + 18*e^(-8*d*x - 8*c) + 9*e^( 
-10*d*x - 10*c))/(d*(6*e^(-2*d*x - 2*c) + 15*e^(-4*d*x - 4*c) + 20*e^(-6*d 
*x - 6*c) + 15*e^(-8*d*x - 8*c) + 6*e^(-10*d*x - 10*c) + e^(-12*d*x - 12*c 
) + 1))) + 1/3*b^3*(3*x + 3*c/d + 3*log(e^(-2*d*x - 2*c) + 1)/d + 8*(3*e^( 
-2*d*x - 2*c) + 9*e^(-4*d*x - 4*c) + 25*e^(-6*d*x - 6*c) + 26*e^(-8*d*x - 
8*c) + 25*e^(-10*d*x - 10*c) + 9*e^(-12*d*x - 12*c) + 3*e^(-14*d*x - 14*c) 
)/(d*(8*e^(-2*d*x - 2*c) + 28*e^(-4*d*x - 4*c) + 56*e^(-6*d*x - 6*c) + 70* 
e^(-8*d*x - 8*c) + 56*e^(-10*d*x - 10*c) + 28*e^(-12*d*x - 12*c) + 8*e^(-1 
4*d*x - 14*c) + e^(-16*d*x - 16*c) + 1))) + 3*a^2*b*(x + c/d + log(e^(-2*d 
*x - 2*c) + 1)/d + 4*(e^(-2*d*x - 2*c) + e^(-4*d*x - 4*c) + e^(-6*d*x - 6* 
c))/(d*(4*e^(-2*d*x - 2*c) + 6*e^(-4*d*x - 4*c) + 4*e^(-6*d*x - 6*c) + e^( 
-8*d*x - 8*c) + 1))) + a^3*(x + c/d + log(e^(-2*d*x - 2*c) + 1)/d + 2*e^(- 
2*d*x - 2*c)/(d*(2*e^(-2*d*x - 2*c) + e^(-4*d*x - 4*c) + 1)))
 
3.2.57.8 Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 309 vs. \(2 (99) = 198\).

Time = 0.46 (sec) , antiderivative size = 309, normalized size of antiderivative = 2.89 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right )^3 \, dx=-\frac {3 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} {\left (d x + c\right )} - 3 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) - \frac {2 \, {\left (3 \, {\left (a^{3} + 6 \, a^{2} b + 9 \, a b^{2} + 4 \, b^{3}\right )} e^{\left (14 \, d x + 14 \, c\right )} + 18 \, {\left (a^{3} + 5 \, a^{2} b + 6 \, a b^{2} + 2 \, b^{3}\right )} e^{\left (12 \, d x + 12 \, c\right )} + {\left (45 \, a^{3} + 198 \, a^{2} b + 237 \, a b^{2} + 100 \, b^{3}\right )} e^{\left (10 \, d x + 10 \, c\right )} + 4 \, {\left (15 \, a^{3} + 63 \, a^{2} b + 78 \, a b^{2} + 26 \, b^{3}\right )} e^{\left (8 \, d x + 8 \, c\right )} + {\left (45 \, a^{3} + 198 \, a^{2} b + 237 \, a b^{2} + 100 \, b^{3}\right )} e^{\left (6 \, d x + 6 \, c\right )} + 18 \, {\left (a^{3} + 5 \, a^{2} b + 6 \, a b^{2} + 2 \, b^{3}\right )} e^{\left (4 \, d x + 4 \, c\right )} + 3 \, {\left (a^{3} + 6 \, a^{2} b + 9 \, a b^{2} + 4 \, b^{3}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{8}}}{3 \, d} \]

input
integrate(tanh(d*x+c)^3*(a+b*tanh(d*x+c)^2)^3,x, algorithm="giac")
 
output
-1/3*(3*(a^3 + 3*a^2*b + 3*a*b^2 + b^3)*(d*x + c) - 3*(a^3 + 3*a^2*b + 3*a 
*b^2 + b^3)*log(e^(2*d*x + 2*c) + 1) - 2*(3*(a^3 + 6*a^2*b + 9*a*b^2 + 4*b 
^3)*e^(14*d*x + 14*c) + 18*(a^3 + 5*a^2*b + 6*a*b^2 + 2*b^3)*e^(12*d*x + 1 
2*c) + (45*a^3 + 198*a^2*b + 237*a*b^2 + 100*b^3)*e^(10*d*x + 10*c) + 4*(1 
5*a^3 + 63*a^2*b + 78*a*b^2 + 26*b^3)*e^(8*d*x + 8*c) + (45*a^3 + 198*a^2* 
b + 237*a*b^2 + 100*b^3)*e^(6*d*x + 6*c) + 18*(a^3 + 5*a^2*b + 6*a*b^2 + 2 
*b^3)*e^(4*d*x + 4*c) + 3*(a^3 + 6*a^2*b + 9*a*b^2 + 4*b^3)*e^(2*d*x + 2*c 
))/(e^(2*d*x + 2*c) + 1)^8)/d
 
3.2.57.9 Mupad [B] (verification not implemented)

Time = 1.88 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.45 \[ \int \tanh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right )^3 \, dx=x\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )-\frac {{\mathrm {tanh}\left (c+d\,x\right )}^4\,\left (3\,a^2\,b+3\,a\,b^2+b^3\right )}{4\,d}-\frac {\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}{d}-\frac {{\mathrm {tanh}\left (c+d\,x\right )}^6\,\left (b^3+3\,a\,b^2\right )}{6\,d}-\frac {b^3\,{\mathrm {tanh}\left (c+d\,x\right )}^8}{8\,d}-\frac {{\mathrm {tanh}\left (c+d\,x\right )}^2\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}{2\,d} \]

input
int(tanh(c + d*x)^3*(a + b*tanh(c + d*x)^2)^3,x)
 
output
x*(3*a*b^2 + 3*a^2*b + a^3 + b^3) - (tanh(c + d*x)^4*(3*a*b^2 + 3*a^2*b + 
b^3))/(4*d) - (log(tanh(c + d*x) + 1)*(3*a*b^2 + 3*a^2*b + a^3 + b^3))/d - 
 (tanh(c + d*x)^6*(3*a*b^2 + b^3))/(6*d) - (b^3*tanh(c + d*x)^8)/(8*d) - ( 
tanh(c + d*x)^2*(3*a*b^2 + 3*a^2*b + a^3 + b^3))/(2*d)